/*
 * Created on 2008-06-08
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package elka.isi.operator.writer;

import org.evolvica.core.IIndividualSet;

import elka.isi.util.RWUtils;

public class PopulationsQuantityWriter extends EcosystemStateWriter {

	public PopulationsQuantityWriter(String filename) {
		super(filename);
	}

	/**
	 * Zapisuje do pliku liczebnosci wszystkich populacji w danym momencie
	 * cyklu, w kazdej iteracji.
	 */
	public void write(IIndividualSet set) {
		int rabbitsCount = RWUtils.getRabbits(set).size();
		int wolvesCount = RWUtils.getWolves(set).size();
		int roesCount = RWUtils.getRoes(set).size();
		writer.append(rabbitsCount + DELIMITER + wolvesCount + DELIMITER + roesCount
				+ "\n");
	}

}
